import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/layout/Index'
const _import = require('./_import_' + process.env.NODE_ENV)
Vue.use(Router)

export default new Router({
   //mode: 'history', // 后端支持可开

  scrollBehavior: () => ({ y: 0 }),
  routes: [
    {
      path: '/', // 对首页进行配置
      name: 'Index page',
      component: Layout,
      redirect: '/home',
      children: [
        { path: 'home', name: '首页', component: _import('tabs/home'), meta: { tabbar: true, belong: 'home' } },
        { path: 'message', name: '消息', component: _import('tabs/message'), meta: { tabbar: true, belong: 'message' } },
        { path: 'finance', name: '财务', component: _import('tabs/finance'), meta: { tabbar: true, belong: 'finance' } },
        { path: 'my', name: '我的', component: _import('tabs/my'), meta: { tabbar: true, belong: 'my' } }
      ]
    },
    {
      path: '/login', // 对首页进行配置
      name: 'Login Page',
      component: _import('login/Index'),
      hidden: true
    }
  ]
})
